import torch.nn as nn

class TemperatureHumidityMLP(nn.Module):
    def __init__(self, input_size, hidden_size1, hidden_size2, num_classes_temp, num_classes_humidity):
        super(TemperatureHumidityMLP, self).__init__()
        self.fc1 = nn.Linear(input_size, hidden_size1)
        self.relu1 = nn.ReLU()
        self.fc2 = nn.Linear(hidden_size1, hidden_size2)  # 第二个隐藏层
        self.relu2 = nn.ReLU()
        self.fc3_temp = nn.Linear(hidden_size2, num_classes_temp)  # 温度分类层
        self.fc3_humidity = nn.Linear(hidden_size2, num_classes_humidity)  # 湿度分类层

    def forward(self, x):
        x = self.fc1(x)
        x = self.relu1(x)
        x = self.fc2(x)
        x = self.relu2(x)
        temp_logits = self.fc3_temp(x)
        humidity_logits = self.fc3_humidity(x)
        return temp_logits, humidity_logits
